package com.learn.my.cotroller;

import com.learn.my.service.TestService;
import org.springframework.beans.factory.annotation.Autowire;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private TestService testService;



    @RequestMapping(value = {"","/"})
    public String Index(){
        return testService.getStr();
    }


    @RequestMapping("/{name}")
    public String Index(@PathVariable("name") String name){
        return "用户名字："+name;
    }
}
